<%-- 
    Document   : facturas
    Created on : 08-24-2012, 09:19:27 AM
    Author     : marco.castro
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

 
<%@ taglib uri="http://www.extremecomponents.org" prefix="ec"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 
<html>

    <head>
			<link href="../resources/css.css" rel="stylesheet" type="text/css" />
			<script type="text/javascript" src="../resources/calendario/calendar.js"></script>
			<script type="text/javascript" src="../resources/calendario/calendar-setup.js"></script>
			<script type="text/javascript" src="../resources/calendario/calendar-es.js"></script>
			<style type="text/css"> @import url("../resources/calendario/calendar-system.css"); </style>
			<link rel="stylesheet" href="../resources/style.css" />
			<script type="text/javascript" src="../resources/javascript/tinybox.js"></script>
				
			
			
			<!-- se agregan librerias para el form Wizard -->
	<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />

<link rel="stylesheet" type="text/css" media="screen" href="../resources/cmxform.css" />
<style type="text/css">

	#tabs_wrapper {
    width: 422px;
}
#tabs_container {
    border-bottom: 1px solid #ccc;
}
#tabs {
    list-style: none;
    padding: 5px 0 4px 0;
    margin: 0 0 0 10px;
    font: 0.75em arial;
}
#tabs li {
    display: inline;
}
#tabs li a {
    border: 1px solid #ccc;
    padding: 4px 6px;
    text-decoration: none;
    background-color: #eeeeee;
    border-bottom: none;
    outline: none;
    border-radius: 5px 5px 0 0;
    -moz-border-radius: 5px 5px 0 0;
    -webkit-border-top-left-radius: 5px;
    -webkit-border-top-right-radius: 5px;
}
#tabs li a:hover {
    background-color: #dddddd;
    padding: 4px 6px;
}
#tabs li.active a {
    border-bottom: 1px solid #fff;
    background-color: #fff;
    padding: 4px 6px 5px 6px;
    border-bottom: none;
}
#tabs li.active a:hover {
    background-color: #eeeeee;
    padding: 4px 6px 5px 6px;
    border-bottom: none;
}
 
#tabs li a.icon_accept {
    background-image: url(accept.png);
    background-position: 5px;
    background-repeat: no-repeat;
    padding-left: 24px;
}
#tabs li a.icon_accept:hover {
    padding-left: 24px;
}
 
#tabs_content_container {
    border: 1px solid #ccc;
    border-top: none;
    padding: 10px;
    width: 400px;
}
.tab_content {
    display: none;
}
</style>
	
    <title>Turn plain webform into a powerful wizard with jQuery</title>
    
    <script type="text/javascript">
    ​​
    function showEditBtn(){
    	$(".btnEditar").hide("fast");
    	$(".btnAgregar").hide("slow");
    	$(".btnEditar").show("slow");
    	
    }

    function hiddenEditBtn(){
    	$(".btnEditar").hide("fast");
    	$(".btnAgregar").show("slow");								
    }

    function edit(formulario,accion){				
    	
    	var nav= $.browser;
    	
    	if(nav.msie){

    		var form =  document.getElementById(formulario);
    		form.action=accion;
    		form.submit();
    	}
    	else{
    		
    		var form = document.forms[formulario];
    		form.action = accion;
    		form.submit;
    		
    	}
    																	
    }


    function convertDate(stringdate) 
    { 
        // Internet Explorer does not like dashes in dates when converting,  
        // so lets use a regular expression to get the year, month, and day  
        var DateRegex = /([^-]*)-([^-]*)-([^-]*)/; 
        var DateRegexResult = stringdate.match(DateRegex); 
        var DateResult; 
        var StringDateResult = ""; 
     	
        // try creating a new date in a format that both Firefox and Internet Explorer understand 
        try 
        { 
            DateResult = new Date(DateRegexResult[2]+"/"+DateRegexResult[3]+"/"+DateRegexResult[1]); 
        }  
        // if there is an error, catch it and try to set the date result using a simple conversion 
        catch(err)  
        {  
            DateResult = new Date(stringdate);  
        } 
     	
        var numCeros = "00";
        // format the date properly for viewing 
        //alert("dia " + DateResult.getDate() + " Mes " + DateResult.getMonth() + "Año "+ DateResult.getFullYear() + "tamaño dia " +numCeros.substring(0,numCeros.length-String(DateResult.getDate()).length) + String(DateResult.getDate()));
        
        StringDateResult = (numCeros.substring(0,numCeros.length-String(DateResult.getDate()).length) + String(DateResult.getDate()))+"/"+(numCeros.substring(0,numCeros.length-String(DateResult.getMonth()+1).length) + String(DateResult.getMonth()+1))+"/"+(DateResult.getFullYear()); 
     
        return StringDateResult; 
    } 






    function soloNumeros(evt){
    	
    	//asignamos el valor de la tecla a keynum
    	if(window.event){// IE
    	keynum = evt.keyCode;
    	}else{
    	keynum = evt.which;
    	}
    	//comprobamos si se encuentra en el rango
    	if(keynum>47 && keynum<58){
    	return true;
    	}else{
    	return false;
    	}
    	}
    	
    function soloMoneda(event) { 
    		if ((event.which != 46 || $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) { 
    			event.preventDefault(); 
    			}
    		}


    function MoneyFormat(amount) { 
    	var val = parseFloat(amount); 
    	if (isNaN(val)) { return "0.00"; } 
    	if (val <= 0) { return "0.00"; } 
    	val += ""; 
    	// Next two lines remove anything beyond 2 decimal places 
    	if (val.indexOf('.') == -1) { return val+".00"; } 
    	else { val = val.substring(0,val.indexOf('.')+3); } 
    	val = (val == Math.floor(val)) ? val + '.00' : ((val*10 == 
    	Math.floor(val*10)) ? val + '0' : val); 
    	return val; 
    	} 
    	
    	
    function validateMail(idMail)
    {
    	//Creamos un objeto 
    	object=document.getElementById(idMail);
    	valueForm=object.value;

    	// Patron para el correo
    	var patron=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
    	if(valueForm.search(patron)==0)
    	{
    		//Mail correcto
    		object.style.color="#000";
    		return;
    	}
    	//Mail incorrecto
    	object.style.color="#f00";
    }


    function soloLetras(e){
    	 key = e.keyCode || e.which;
    	 tecla = String.fromCharCode(key).toLowerCase();
    	 letras = " áéíóúabcdefghijklmnñopqrstuvwxyz1234567890";
    	 especiales = [8,37,46,64];

    	 tecla_especial = false
    	 for(var i in especiales){
    	     if(key == especiales[i]){
    	  tecla_especial = true;
    	  break;
    	            } 
    	 }
    	 
    	        if(letras.indexOf(tecla)==-1 && !tecla_especial)
    	     return false;
    	     }
    	     
    	     
    	     
    function formateaFecha(name){
        //alert("------------------");
        var item = document.getElementById(name).value;
        var i;
        if(item != ""){
                       var date2 = "", mes="",dia="",anio="";
        var fechaC = null;
        var anioint = null;                              
                       for(i=0;i<item.toString().length;i++)
                       {
                       if(item.charAt(i)=='-'){
                                       fechaC = item.split("-");
                                       break;
                       }
                       if(item.charAt(i)=='/'){
                                       fechaC = item.split("/");
                                       break;
                       }                              
                       }
                       var anioC = fechaC[2].toString();             
    var mesC = fechaC[1].toString();
    var diaC = fechaC[0].toString();
    anioint = parseInt(anioC); 
    if (mesC.toString().length<2){
                           mes="0".concat(mesC);       
                        }else{
                                        mes=mesC;
                        }                                            
                        if (diaC.toString().length<2){
                           dia="0".concat(diaC);       
                        }else{
                                        dia = diaC;
                        }                             
                        if (anioC.toString().length==2 && anioint<30){
                                        anio="20".concat(anioC);                                                                                          
                        }else if(anioC.toString().length==2 && anioint>30){
                                       anio="19".concat(anioC); 
                        }
                        else{
                                        anio=anioC;
                        }
                        date2 = anio.toString() + "-" + mes.toString() + "-" +  dia.toString();  
                        //document.getElementById(name).value = date2; 
        }else{
                       date2 = "";
        }                              
                        return date2;
    }

    
    		function mun(idMunicipio,municipio){
				$("#idMunicipio").val(idMunicipio);
				$("#municipio").val(municipio);
			}
			
			
				
    	    function editForm(formulario,accion){				
    	    	
    	    	var nav= $.browser;
    	    	
    	    	if(nav.msie){

    	    		var form =  document.getElementById(formulario);
    	    		form.action=accion;
    	    		form.submit();
    	    	}
    	    	else{
    	    		
    	    		var form = document.forms[formulario];
    	    		form.action = accion;
    	    		
    	    		
    	    	}
    	    																	
    	    }
		</script>
		 <script>
    $(function() {
    	
        //$( "#tabs" ).tabs();
        $("#tabs").tabs({
                selected: 0,
                select: function(event, ui){
                  // remove the class from the previously selected tab
                  $("td.ui-tabs-selected").removeClass("ui-tabs-selected");

                  // add the class to the new one; need to get 2 parents because ui.tab will return the anchor tag
                  $(ui.tab).parent().parent().addClass("ui-tabs-selected");

                }
              }); 
       
    });
    </script>
</head>

<body>
<form:form method="post" id="ingresoEmp" action="ingresoExpediente" commandName="sferhExpediente" >
<form:hidden path="sferhEmpleado.idEmpleado"/>
</form:form>
						<div id="tabs">
						<ul>
						<li id="li1"><a href="<%request.getContextPath();%>expedienteIngreso?idEmpleado=${sferhExpediente.sferhEmpleado.idEmpleado}">Ingreso de Expediente</a></li>
						<li><a href="#tab-2">Informacion Laboral</a></li>
						<li><a href="<%request.getContextPath();%>showPersonal">Empleados</a></li>
						</ul>
						
						<div id="tab-2">Tab 2 Content</div>
						</div>
        </body>
</html>
